/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "jurusan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Jurusan.findAll", query = "SELECT j FROM Jurusan j")})
public class Jurusan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "jurusan_id")
    private String jurusanId;
    @Column(name = "jurusan_nama")
    private String jurusanNama;
    @Column(name = "jurusan_idmk")
    private String jurusanIdmk;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "jurusan")
    private List<Mhs> mhsList;
    @OneToMany(mappedBy = "jurusan")
    private List<Kuliah> kuliahList;

    public Jurusan() {
    }

    public Jurusan(String jurusanId) {
        this.jurusanId = jurusanId;
    }

    public String getJurusanId() {
        return jurusanId;
    }

    public void setJurusanId(String jurusanId) {
        this.jurusanId = jurusanId;
    }

    public String getJurusanNama() {
        return jurusanNama;
    }

    public void setJurusanNama(String jurusanNama) {
        this.jurusanNama = jurusanNama;
    }

    public String getJurusanIdmk() {
        return jurusanIdmk;
    }

    public void setJurusanIdmk(String jurusanIdmk) {
        this.jurusanIdmk = jurusanIdmk;
    }

    @XmlTransient
    public List<Mhs> getMhsList() {
        return mhsList;
    }

    public void setMhsList(List<Mhs> mhsList) {
        this.mhsList = mhsList;
    }

    @XmlTransient
    public List<Kuliah> getKuliahList() {
        return kuliahList;
    }

    public void setKuliahList(List<Kuliah> kuliahList) {
        this.kuliahList = kuliahList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (jurusanId != null ? jurusanId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Jurusan)) {
            return false;
        }
        Jurusan other = (Jurusan) object;
        if ((this.jurusanId == null && other.jurusanId != null) || (this.jurusanId != null && !this.jurusanId.equals(other.jurusanId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "toesp.entity.Jurusan[ jurusanId=" + jurusanId + " ]";
    }
    
}
